package com.t2b.thaicalendar.view;

import android.content.Context;
import android.view.Gravity;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by j1tth4 on 6/29/14.
 */
public class DayNameView extends LinearLayout{
    public static final int TEXT_APPEARANCE = android.R.style.TextAppearance_Holo_Inverse;
    private String[] mDayNames;

    public DayNameView(Context context, String[] daysName){
        super(context);
        mDayNames = daysName;
        drawDaysName();
    }

    protected void drawDaysName(){
        for(String day : mDayNames) {
            TextView tvDaysName = new TextView(getContext());
            tvDaysName.setTextAppearance(getContext(), TEXT_APPEARANCE);
            tvDaysName.setAllCaps(true);
            tvDaysName.setGravity(Gravity.CENTER);
            tvDaysName.setText(day);
            addView(tvDaysName, Utils.getHorizonParams());
        }
    }
}
